<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in list" :key="item.categoryId">
        <img :src="item.imgUrl" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { getSliders } from "../../../api";
export default {
  data() {
    return {
      list: [],
    };
  },
  methods: {},
  created() {
    getSliders((res) => {
      this.list = res.data;
    });
  },
};
</script>

<style lang="scss" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 20px;
  text-align: center;
  background-color: #39a9ed;
}
img {
  width: 100%;
  height: 100%;
}
</style>